import { CoolController, BaseController } from '@cool-midway/core';
import { BroadcastFileEntity } from '../../entity/file';
import { BroadcastFileService } from '../../service/file';
import { Body, Inject, Post } from '@midwayjs/core';

/**
 * broadcast-file
 */
@CoolController({
  api: ['add', 'delete', 'update', 'info', 'list', 'page'],
  entity: BroadcastFileEntity,
  service: BroadcastFileService
})
export class AdminBroadcastFileController extends BaseController {
  @Inject()
  broadcastFileService: BroadcastFileService;

  /**
  * 同步文件
  */
  @Post('/synchronize', { summary: '日志保存时间' })
  public async synchronize(@Body() info) {
    return this.ok(await this.broadcastFileService.synchronize(info));
  }
}
